﻿@model VideoCache.Server.ViewModel.AlbumModel
@{
    ViewBag.Title = "Edit";
}
<h2>Edit</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.Title)
    <div class="unit">
        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Title, new { style = "width:400px" })
            @Html.ValidationMessageFor(model => model.Title)
        </div>
            <div class="editor-field">
            <button type="button" id="btnSearch" onclick="searchBaidu()">从百度查找</button>
        </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.TypeId)
    </div>
    <div class="editor-field">
        @Html.DropDownList("TypeId", "请选择")
        @Html.ValidationMessageFor(model => model.TypeId)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.AreaId)
    </div>
    <div class="editor-field">
        @Html.DropDownList("AreaId", "请选择")
        @Html.ValidationMessageFor(model => model.AreaId)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Rating)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.Rating)
        @Html.ValidationMessageFor(model => model.Rating)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Actor)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Actor, new { style = "width:400px" })
        @Html.ValidationMessageFor(model => model.Actor)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Director)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Director, new { style = "width:400px" })
        @Html.ValidationMessageFor(model => model.Director)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.PubYear)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.PubYear)
        @Html.ValidationMessageFor(model => model.PubYear)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.IsEnd)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.IsEnd)
        @Html.ValidationMessageFor(model => model.IsEnd)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Priority)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.Priority)
        @Html.ValidationMessageFor(model => model.Priority)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Status)
    </div>
    <div class="editor-field">
        @Html.DropDownList("Status", "请选择")
        @Html.ValidationMessageFor(model => model.Status)
    </div>
    </div>

    <div class="unit">
    <div class="editor-label">
        @Html.LabelFor(model => model.Description)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.Description, new { style = "width:400px", rows = "8" })
        @Html.ValidationMessageFor(model => model.Description)
    </div>
    </div>
    
    <div class="unit">
        <div class="editor-label"></div>
        <div class="editor-field">
        <input type="submit" value="Create" />
        @Html.ActionLink("Back to List", "Index")
        </div>
    </div>
    
    <div class="unit">
        <table width="100%" class="list">
        <thead>
            <th width="100">搜索引擎</th>
            <th>网址</th>
            <th width="120"></th>
        </thead>
        <tbody>
        @foreach (VideoCache.Server.Model.AlbumSearchEngineeLinkInfo info in (List<VideoCache.Server.Model.AlbumSearchEngineeLinkInfo>)ViewBag.SearchEnginee)
        {
            <tr>
                <td>@info.SearchEnginee</td>
                <td><a href="http://@info.Url">@info.Url</a></td>
                <td>
                    <a href="@Url.Action("EditSearchEnginee", new { id = info.Id })">修改</a> |
                    <a href="@Url.Action("DeleteSearchEnginee", new { id = info.Id })" class="delete">删除</a>
                </td>
            </tr>
        }
        </tbody>
        <tfoot>
            <tr>
                <td colspan="3"><a href="@Url.Action("CreateSearchEnginee", new { albumId = Model.Id })">添加搜索引擎绑定</a></td>
            </tr>
        </tfoot>
        </table>
    </div>
}